
function performUpdate(form_id) {
	$(form_id).request({
		requestHeaders: ['Accept', 'application/xhtml+xml'],
		method: 'put',
		onSuccess: function() {
			document.location.reload();	
		}
	});
};

function toggleDebug() {

        var md_debug = $('debug_mode')
        var debug_mode_on = ( md_debug.textContent == 'true');
        var debug_elements = $$("div[class~='debug']");
        
        debug_elements.each(function(s) {
          if (debug_mode_on)
              s.show()
          else
              s.hide()
        });
        
        var a_td = $('toggle_debug');
        a_td.update(debug_mode_on ? 'No debug' : 'Debug');
        md_debug.update( debug_mode_on ? 'false' : 'true');
};